-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-10090: Add AmqpClientInboundGateway
#10447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-10090: Add AmqpClientInboundGateway
#10447
Conversation
|
After doing this, I don't see a value in the The So, the point is that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Just a couple of doc questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet!
I'll merge once it successfully builds.
|
Hold on from merging, please. |
|
On hold till I get the go ahead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on consolidating the code. The red is always pleasing to see! :-)
Just a couple of nitpicks.
| * @param delegate the {@link AmqpAcknowledgment} to delegate to. | ||
| * Use as {@link java.util.function.BiConsumer} for the {@link IntegrationRabbitAmqpMessageListener}. | ||
| * @param messageToSend the message to produce from this endpoint. | ||
| * @param requestMessage the request AMQP message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may want to mention that the requestMessage is ignored in this processRequest.
| try { | ||
| this.requestAction.accept(messageToSend, message); | ||
| } | ||
| catch (Exception ex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a RuntimeException?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the point.
We have to re-throw anything as a ListenerExecutionFailedException and ErrorHandler in the listener container will be able to parse this and its cause respectively.
|
|
||
| @Override | ||
| public void onMessage(org.springframework.amqp.core.Message message) { | ||
| throw new UnsupportedOperationException("The 'RabbitAmqpMessageListener' does not implement 'onMessage()'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it read, The 'IntegrationRabbitAmqpMessageListener' does not implement 'onMessge'?
Related to: spring-projects#10090 * Add `AmqpClientInboundGateway` that is mostly a copy/paste of the `AmqpClientMessageProducer`, but adds a reply-producing logic * Cover with tests and document this new component * Fix a couple typos in the `amqp-1.0.adoc`
…ckage private) class. Serves as a reusable unit of work for both `AmqpClientMessageProducer` & `AmqpClientInboundGateway`. The one-way and request-reply parts are handled as a `BiConsumer` action injection into this `IntegrationRabbitAmqpMessageListener` instance. Now both `AmqpClientMessageProducer` & `AmqpClientInboundGateway` are much simpler.
mentioning that `requestMessage` param is out of use * Be more specific with the type for `UnsupportedOperationException` in the `IntegrationRabbitAmqpMessageListener`
fe22890 to
73cf36c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This is Awesome!
Related to: #10090
AmqpClientInboundGatewaythat is mostly a copy/paste of theAmqpClientMessageProducer, but adds a reply-producing logicamqp-1.0.adoc